<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/html/axios.min.js"></script>
<script src="/html/util.js"></script>
<script>
    var id = getQuery("id");
    function push(){
        axios.get("/topic/add",{
            params:{
                name:$('title').value,
                info:$('content').value,
                channelId:id
            }
        }).then(e => {
            if (e.data=='ok'){
                location.href = "/html/main.html";
            }else {
                location.href = "/html/login.html"
            }
        })
    }
</script>
<body>
    <span id="infoSpan" style="color: #ff0000"></span>
    标题:<input type="text" id="title"><br>
    内容:<textarea id="content"></textarea>
    <input type="button" value="发布" onclick="push()">
</body>
</html>